import Vue from 'vue'
import VueRouter from 'vue-router'
import Hao123 from '../views/Hao123.vue'
import xinwen from "@/components/haoxw.vue";
import youxi from "@/components/haoyouxi.vue";
import yule from "@/components/haoyule.vue";
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: "/youxi",
    component: Hao123,
    children: [
      {
        path: 'youxi',
        children: [
          {
            path: 'tuiguanA',
            component: () => import( /* mylol */ '@/components/lol.vue')
          },
          {
            path: 'tuiguanB',
            component: () => import( /* myzd */ '@/components/zd.vue')
          }
        ],
        component: youxi,
        meta: {
          requireAuth: true,
          title: "游戏",
        },

      },
      {
        path: 'yule',
        component: yule,
        meta: {
          requireAuth: false,
          title: "娱乐"
        },
      },
      {
        path: 'xinwen',
        component: xinwen,
        meta: {
          requireAuth: true,
          title: "新闻"
        },
      }
    ]
  },
  {
    path: '/about',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  }


]

const router = new VueRouter({
  routes
})

export default router
